The prior art file management system is outlined in a block diagram in FIG. 11.
The prior art file system as illustrated in FIG. 11 is so configured that the storage area in the storage device 900 is divided into data blocks of a certain size, 8 kilobytes, for example, each data block given a block number and its occupation status managed by an unoccupied block management means 40. The blocks already allocated for a specific file are registered on a block table which is stored in the storage device 900, and are used for writing or reading out data as described below.
FIG. 12 is a conceptional diagram showing the configuration of the block table Tb in the aforesaid prior art file management system. On the block table Tb, the block number Bn (B1, B2, B3, B4, . . . Bk) is registered in order of the corresponding file offset 0n.
It should be understood that for purpose of this specification, file offset is a measure of quantity of data or data size from the head of the file The suffix On corresponds to the code number given to each data fragment when data is fragmented by the specific size (one block size, for example), and can indicate the position or address in a file. It also indicates the data size at a specific offset address. File offset 04, for example, means four times the data size of offset 01.
When a new file is to be created, a file creating means 10 directs a data block allocation means 30 to acquire block numbers for the new file, indicating the file offset On, and gives data to write to a data writing means 20 at the same time.
The data block allocation means 30 first reads out the block table Tb stored on the storage device 900 and checks to see whether the area (data block) corresponding to the indicated file offset On is already allocated for the file to write or not.
In case a data block is already allocated in the area corresponding to the indicatecd file offset On, that is, a block number Bn is registered, then the said block number bn is taken out. If no data block is allocated yet, the unoccupied block management means 40 is ordered to search for a new data block.
The said unoccupied block management means 40, which manages the occupation status of the respective data blocks and the current number of unoccupied blocks in the whole file management system as mentioned above, notifies the data block allocation means 30 of the block number Bn read out by the an unoccupied block management means 40.
The data block allocation means 30 registers on the block table Tb the received block number Bn in such a way that the block number is paired with the file offset On acquired from the file creating means 10 and stores this block table Tb on the storage device 900. The data block allocation means 30 informs the data writing means 20 of the acquired block number Bn at the same time. The data writing means 20 then writes data into the space at the received block number Bn on the storage device 900.
When data in a specific file is to be read out at the request from outside in this system (in practice, the request is made by specifying or inputting subheading from outside when the requirement of a subheading from the top is provided, and the file read-out means acquires an offset On on the basis of the inputted data), the file read-out means 50 notifies a block take-out means 60 of the file offset On. The block take-out means 60 in turn reads out the block table Tb stored on the storage device 900 and acquires from the block table Tb the block number Bn corresponding to the given file offset On, and informs the data read-out means 70 of the block number.
Receiving the block number Bn, the data read-out means 70 reads out the object data from the space at that block number Bn On the storage device 900 and forwards the same to the file read-out means 50.
If the point specified as starting file offset address for writing a new data is one or more data block size down from the end point of last file offset, there occurs a block region Az without real data or dummy blocks on the block table Tb as shown in FIG. 3.
In the usual file management, even if continuous data are written in data blocks which are apart from each other, each block is arranged consecutively on the block table Tb. As shown in FIG. 13, for example, data on 0s0.about.0s9 were written in block B10 to block B19. When another continuous data on offset 0s10 downward are going to be written in blocks on B20 downward, it is found that somehow the blocks from B20 to B29 had already been occupied by other data, so that, the new data are written in vacant blocks from B60 downward instead. Even in such a case, the block table Tb stores both data up to offset 0s9 and data from offset 0s10 downward as one consecutive or continuous data as shown in FIG. 13(b).
It is to be understood that the block region (dummy blocks) without real data which is described here is so purposely created that other data may be written later as shown in FIG. 3.
There are two methods to protect the block region without real data, one in which data blocks are allocated in that block region without fail and the other in which no data blocks are allocated.
In the prior art file management system in which data blocks are allocated without fail in the block region without real data, arrangements are made this way: dummy data, 0 (or 1)-cleared data, for example, is written in the allocated data blocks without real data so that no indetified data may come out from the block region without real data in the read-out step.
In the prior art file management system which allocates no data blocks in the block region without real data, the block take-out means 60 checks the corresponding space in the block table Tb to find, on reading out from the block region without real data, that no data block is allocated yet, and informs the data read-out means 70 that no data block is present. Then, the data read-out means 70 prepares and forwards dummy data to the file read-out means 50. And when real data is written later in the block region without real data, a step to allocate data blocks is executed anew.
In the prior art file management system which allocates data block without fail in the block region without real data, there will take place simultaneously allocation of blocks and writing dummy data in the block region without real data if a file offset address not consecutive but apart from the end point of last file is specified for writing a new data.
As it often happens that real data is written later in the block region without real data, it is a waste of time to write dummy data.
In the prior art file management system which allocates no data blocks in the block region without real data, data blocks should be allocated in the block region without real data when real data is written later in that block region.
Since, however, no data blocks are allocated in the block region without real data, a data in some other file initially written occupies the block region. There is no assurance that the unoccupied blocks are left to be allocated for the intended writing of data. Thus it may fail to write real data in the unoccupied block.
The present invention is to resolve such problems with the prior art file management system as described above. And it is an object of the present invention to provide a file management system and a method of managing the same in which in writing data, no dummy data is written in the block region without real data but it will be ensured that in case real data is written later in the block region without real data, data blocks are available which can be allocated in the block region without real data.